<?php

class BackendVideoForm extends VideoForm
{
  public function configure()
  {
    unset(
      $this['created_at'],
      $this['updated_at'],
      $this['comment_cnt'],
      $this['publisher_id']
    );
    
    $this->widgetSchema['area_id']->addOption('table_method', 'getAdminAreaListQuery');
    
    $this->widgetSchema['thumb'] = new sfWidgetFormInputFileEditable(array(
      'is_image' => true,
      'edit_mode' => !$this->isNew(),
      'file_src' => sprintf(sfConfig::get('app_path_video_thumb'), $this->getObject()->getThumb()),
      'with_delete' => false
    ));

    $this->validatorSchema['thumb'] = new sfValidatorFile(array(
      'max_size' => 1 * 1024 * 1024,
      'path' => Wills::getUploadDirByWebPath(sfConfig::get('app_path_video_thumb')),
      'mime_types' => 'web_images'
    ));

    $this->validatorSchema['thumb']->setOption('required', false);
  }
}
